#pragma once
#include "cgzCTcpS.h"

class cgzCTcpGateS : public cgzCTcpS
{
public:
    cgzCTcpGateS(
        cgzCThreadPool *pool, 
        const char *name, 
        const std::string ip, 
        const int port, 
        const int cid,
        const bool gate);
    virtual ~cgzCTcpGateS();

public:
    virtual bool sticking(cgzCTcpFd *fdinfo);
    virtual bool todoret(cgzCTcpFd *fdinfo, cgzHeader &header);
    virtual bool todoret(cgzCTcpFd *fdinfo, cgzGateHeader &header);
    bool run(cgzCLoopS* task) override;

private:
    bool m_gate;
    //{[msgid] = targetid}
    std::unordered_map<int, int> m_gates;
};
